import cn.wolfcode.cloud.domain.Product;
import com.example.orderserver.domain.Order;
import com.example.orderserver.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/orders")
public class OrderController {
    @Autowired
    private IOrderService productService;
    @RequestMapping("/list")
    public List<Product> list() {  return productService.list(); }
        @RequestMapping("/find")
        public Product find (@RequestParam("id") Long id){
            return productService.get(id);
        }

    }